package o;

import android.content.Intent;
import com.huawei.appgallery.foundation.account.bean.UserSession;

public final class drk implements AccountBussinessListener {
    private static final byte[] ˏ = new byte[0];
    private static drk ॱ = new drk();
    private String ˊ = UserSession.getInstance().getUserId();
    private boolean ˋ = false;

    private drk() {
    }

    public static drk ˏ() {
        synchronized (ˏ) {
            if (ॱ == null) {
                ॱ = new drk();
            }
        }
        ॱ.ॱ();
        return ॱ;
    }

    private synchronized void ॱ() {
        this.ˋ = false;
    }

    public void onAccountBusinessResult(ccp o_ccp) {
        Intent intent;
        if (102 == o_ccp.ˎ) {
            String userId = UserSession.getInstance().getUserId();
            boolean isLoginSuccessful = UserSession.getInstance().isLoginSuccessful();
            if (!this.ˋ || (userId != null && !userId.equals(this.ˊ) && isLoginSuccessful)) {
                this.ˊ = userId;
                this.ˋ = true;
                intent = new Intent("com.huawei.appmarket.service.broadcast.LoginForDetail");
                intent.putExtra("ACTION_LOGIN_DETAIL_PARAM_TYPE", 1);
                ll.ˏ(ContentManager.getInstant().getContext()).ˋ(intent);
            }
        } else if (o_ccp.ˎ == 103 && this.ˋ) {
            this.ˋ = false;
            intent = new Intent("com.huawei.appmarket.service.broadcast.LoginForDetail");
            intent.putExtra("ACTION_LOGIN_DETAIL_PARAM_TYPE", 2);
            ll.ˏ(ContentManager.getInstant().getContext()).ˋ(intent);
        }
    }
}
